
export const ActionConstant = {
    type_editor_operator_exact: 'TYPE_EDITOR_OPERATOR_EXACT',
    type_editor_operator_subtract: 'TYPE_EDITOR_OPERATOR_SUBTRACT',
    type_editor_operator_synonyms: 'TYPE_EDITOR_OPERATOR_SYNONYMS',
    type_editor_operator_may: 'TYPE_EDITOR_OPERATOR_MAY',
    type_editor_operator_from: 'TYPE_EDITOR_OPERATOR_FROM',
    type_editor_operator_to: 'TYPE_EDITOR_OPERATOR_TO',
    type_clear_operator: 'TYPE_CLEAR_OPERATOR',

    type_editor_command_site: 'TYPE_EDITOR_COMMAND_SITE',
    type_editor_command_intitle: 'TYPE_EDITOR_COMMAND_INTITLE',
    type_editor_command_inurl: 'TYPE_EDITOR_COMMAND_INURL',
    type_editor_command_inanchor: 'TYPE_EDITOR_COMMAND_INANCHRO',
    type_clear_command: 'TYPE_CLEAR_COMMAND',

    type_select_result_filetype: 'TYPE_SELECT_RESULT_FILE_TYPE',
    type_select_result_last_update: 'TYPE_SELECT_RESULT_LAST_UPDATE',
    type_clear_result: 'TYPE_CLEAR_RESULT',

    type_editor_input: 'TYPE_EDITOR_INPUT',
};


export const edit_multi = (former_text, current_text, type, index) => {
    return {
        type: type,
        former_text: former_text,
        current_text: current_text,
        index: index
    }
}

export const edit_range = (type, value) => {
    return {
        type: type,
        value: value
    }
}

export const edit_site = (value) => {
    return {
        type: ActionConstant.type_editor_command_site,
        value: value
    }
}

export const select_result = (type, index) => {
    return {
        type: type,
        index: index,
    }
}

export const editor_input = (value) => {
    return {
        type: ActionConstant.type_editor_input,
        value: value
    }
}

export const clear = (type) => {
    return {
        type: type
    }
};
